package chase.myrewards.beans;

import java.io.Serializable;
import java.util.ArrayList;

/**
 * Bean class that holds data for recently earned rewards
 * 
 * @author Meena Abdou
 * @date April 24, 2013
 */
public class RecentlyAccruedBean implements Serializable {

	/**
	 * This number must be unique for every class. And it can never change.
	 * You have to generate it automatically by clicking on the class name and
	 * then hitting Ctrl+1.  Then click on Add generated serial version ID. Then
	 * copy these comments on top of the generated id.
	 * 
	 * @serial serialVersionUID
	 */
	private static final long serialVersionUID = -7554812159175391743L;
	
	private int currentBalance;
	private int size;
	private ArrayList<String> programs;
	private ArrayList<String> totalPurchases;
	//private ArrayList<String> recentlyAccrued;
	
	public RecentlyAccruedBean(){
		currentBalance = 0;
		size = 0;
		programs = new ArrayList<String>();
		//recentlyAccrued = new ArrayList<String>();
		totalPurchases = new ArrayList<String>();
	}

	/**
	 * Use these insert functions to populate the lists instead of setters
	 */
	
	public void insert(String program, String purchase){
		programs.add(program);
		//recentlyAccrued.add(accrued);
		totalPurchases.add(purchase);
		size = programs.size();
	}
	
	public void insertProgram(String p){
		programs.add(p);
	}
	
	//public void insertAccrued(String a){
	//	recentlyAccrued.add(a);
	//}
	
	public void insertPurchase(String p){
		totalPurchases.add(p);
	}
	
	public int getCurrentBalance() {
		return currentBalance;
	}

	public void setCurrentBalance(int currentBalance) {
		this.currentBalance = currentBalance;
	}

	public void setSize(int size) {
		this.size = size;
	}

	public int getSize() {
		return size;
	}

	public ArrayList<String> getPrograms() {
		return programs;
	}

	public void setPrograms(ArrayList<String> programs) {
		this.programs = programs;
	}
	
//	public ArrayList getRecentlyAccrued(){
//		return recentlyAccrued;
//	}
	
//	public void setRecentlyAccrued(ArrayList recentlyAccrued){
//	this.recentlyAccrued = recentlyAccrued;
//	}
	
	public ArrayList<String> getTotalPurchases() {
		return totalPurchases;
	}

	public void setTotalPurchases(ArrayList<String> totalPurchases) {
		this.totalPurchases = totalPurchases;
	}
}